package com.hy.entity.pojo;


import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonFormat;

import lombok.Data;
import org.springframework.data.redis.core.RedisHash;

import org.springframework.format.annotation.DateTimeFormat;


import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.sql.Timestamp;
@RedisHash()

@Data
public class HyUser {

  /**
   * 日期
   */
  @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  private String createDate;

  /**
   * 部门ID
   */
  @NotNull(message = "部门不能为空")
  private Integer departmentId;
  /**
   * 密码
   */

  private String password;


  @Pattern(regexp = "^1[3-9]\\d{9}$",message = "手机号格式错误！")
  private String phone;
  /**
   * 性别
   */
  private Byte sex;

  /**
   * 单元ID
   */
  @NotNull(message = "单位不能为空")
  private Integer unitId;
  /**
   * 更新时间
   */
  @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  private String updateDate;
  @TableLogic
  private Integer del;
  /**
   * 用户ID
   */
  @TableId
  private Integer userId;
  /**
   * 用户名
   */
  @NotBlank(message = "姓名不能为空")
  private String username;


  public String getPassword() {
    return this.password;
  }
  public String real() {
    return this.password;
  }
}
